From 891bb8a2a5874d2283b7ebcf100784d63050dbd6 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Mon, 26 Aug 2013 16:21:36 +0000 Subject: [PATCH] Improve coment re:setCodecForCStrings. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4575 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/main.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gpsbabel/main.cc b/gpsbabel/main.cc index d61917323..e136d39b0 100644 --- a/gpsbabel/main.cc +++ b/gpsbabel/main.cc @@ -240,9 +240,11 @@ main(int argc, char* argv[]) arg_stack_t* arg_stack = NULL; #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) - //Qt requires that source files are stored in utf-8 in Qt5 (setCodecForCStrings removed) - //Allow compile for newer Qt, even if testo may fail - //This should be addressed in the Qt4 builds too + // Qt 5.0 uses QString::fromUtf8 to convert from character pointers + // and QBytreArrays to QStrings while previous version of Qt used + // QString::fromAscii. QString::fromAscii used the codec set + // by QTextCode::setCodecForCStrings. + // This makes the converstion consistent between Qt4 and Qt5. QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); #endif -- 2.30.2